package com.qf.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

@Configuration
public class RedisConfig {
    @Value("127.0.0.1")
    private String host;
    @Value("6379")
    private Integer port;

    @Bean
    public Jedis getJedis(){
        JedisPool jedisPool = new JedisPool(host, port);
        Jedis resource = jedisPool.getResource();
        return resource;
    }
}
